﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Xml;

namespace Clandestine.Conversations
{
    public class TextPart : ConversationPart
    {
        public string Text = string.Empty;

        public TextPart()
        { }

        public override void Do()
        {
            TextSprite sprText = Fonts.Default2.DrawText(Text);
            sprText.GluedToCamera = true;
            sprText.Position = Window.SpeechPosition;
            sprText.Layer = Window.Layer + DialogueWindow.LayerDifference;

            base.WaitForSelection();

            sprText.Dispose();
        }

        public override List<ConversationPart> ParseXML(XmlTextReader xml)
        {
            this.Text = xml.ReadElementContentAsString();
            return new List<ConversationPart>() { this };
        }
    }
}
